package com.xbongbong.saas.model;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.saas.domain.entity.WorkOrderEvaluateEntity;
import com.xbongbong.saas.domain.entity.ext.WorkOrderEvaluateRateStarEntityExt;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 *
 * @author 刘阳
 * @date 2019/4/15 11:07 AM
 * @since v1.0
 * @version v1.0
 */
public interface WorkOrderEvaluateModel extends IModel<WorkOrderEvaluateEntity> {
    @Override
    Integer insert(WorkOrderEvaluateEntity entity) throws XbbException;

    @Override
    Integer update(WorkOrderEvaluateEntity entity) throws XbbException;

    @Override
    List<WorkOrderEvaluateEntity> findEntitys(Map<String, Object> param);

    @Override
    Integer getEntitysCount(Map<String, Object> param);

    /**
     * Description: 根据id获取workOrderEvaluation数据
     * @param key 数据库id值
     * @return WorkOrderEvaluateEntity
     * @author 刘阳
     * @date 2019/4/15 2:52 PM
     * @since v1.0
     */
    WorkOrderEvaluateEntity getByKey(Long key, String corpid);

    /**
     * Description: 根据工单编号获取工单详细
     * @param   * @param null
     * @return
     * @throws
     * @author 刘阳
     * @date 2019/4/15 6:59 PM
     * @since
     */
    WorkOrderEvaluateEntity getByWorkOrderId(Long workOrderId, String corpid);

    /**
     * 评价星级分组，获取各星级数量
     *
     * @param param 入参
     * @return com.xbongbong.saas.domain.entity.ext.WorkOrderEvaluateRateStarEntityExt
     * @author 徐俊杰
     * @date 2019/4/19 16:24
     * @since v1.0
     */
    List<WorkOrderEvaluateRateStarEntityExt> getRateStarCount(Map<String, Object> param);
    /**
     * 评价星级分组，获取各星级数量
     *
     * @param corpid 公司id
     * @param workOrderIdSet 工单id集合
     * @return java.util.List<com.xbongbong.saas.domain.entity.ext.WorkOrderEvaluateRateStarEntityExt>
     * @author 徐俊杰
     * @date 2019/4/22 11:25
     * @since v1.0
     */
    List<WorkOrderEvaluateRateStarEntityExt> evaluateListByWorkOrderIdSet(String corpid, Set<Long> workOrderIdSet);

    Integer save(WorkOrderEvaluateEntity workOrderEvaluateEntity) throws XbbException;
}
